<template>
  <div class="container">
    <topTitle
      :titleText="titleText"
      :back="back"
      @gobackTriser="goBack"
    ></topTitle>
    <div class="mainCon">
      <el-form
        :model="formData"
        ref="formData"
        label-width="130px"
        class="demo-formData"
      >
        <table cellspacing="0" cellpadding="0" class="detailTable">
          <tbody>
            <tr>
              <td class="title">年份</td>
              <td>{{ formData.year || '--' }}</td>
              <td class="title">批次号</td>
              <td>{{ formData.batchNo || '--' }}</td>
            </tr>
            <tr>
              <td class="title">违法主体</td>
              <td>{{ formData.companyName || '--' }}</td>
              <td class="title">统一社会信用代码或身份证号</td>
              <td>{{ formData.uscc || '--' }}</td>
            </tr>
            <tr>
              <td class="title">地址</td>
              <td>{{ formData.address || '--' }}</td>
              <td class="title">法定代表人或负责人</td>
              <td>{{ formData.header || '--' }}</td>
            </tr>
            <tr>
              <td class="title">主要违法事实</td>
              <td colspan="3">{{ formData.eventReason || '--' }}</td>
            </tr>
            <tr>
              <td class="title">查处情况</td>
              <td colspan="3">{{ formData.investigate || '--' }}</td>
            </tr>
          </tbody>
        </table>
      </el-form>
    </div>
  </div>
</template>
<script>
export default {
  name: 'bigUnlawerCaseDetail',

  data() {
    return {
      titleText: '重大事件详情',
      back: true,
      formData: {
        id: '',
        typeId: '', //事件类型（字典）
        accidentId: '', //事件原因（字典）
        accidentDate: '', //2019/11/19--事件发生日期
        address: '', //--事件发生地址
        accidentRank: '', //--事件级别（枚举：01-一般，05-严重，10-重大
        preciseTypeName: '', //事件类别
        involvedRangeId: '', //--涉案人数区间（字典）
        illustration: '', //--事件说明
        projectName: '', //--项目名称
        uscc: '', //--企业USCC
        companyName: '', //--企业名称
        industryId: '', //--行业ID
        areaId: '', //--1502区域Id
        file: [],
      },
    }
  },

  created() {
    this.formData.id = this.$route.query.id
    this.getDetail(this.formData.id)
  },

  methods: {
    getDetail(id) {
      this.axios({
        method: 'post',
        url: 'api-r/seriousEventHandler/get',
        data: {
          id: id,
        },
      })
        .then((response) => {
          this.formData = response.data.result
        })
        .catch((error) => {
          this.$message.error('数据获取失败')
        })
    },

    goBack() {
      this.$router.push('/home/kMCaseComplaint/bigUnlawerCase')
      this.$store.commit('GOBACK_NAME', {
        oldUrl: '/home/kMCaseComplaint/bigUnlawerCase',
        newUrl: this.$router.currentRoute.fullPath,
      })
    },
  },
}
</script>
<style scoped lang="less">
.container {
  .mainCon {
    padding-left: 24px;
    padding-right: 24px;
    height: calc(100% - 67px);
    color: #333;
    font-size: 14px;
  }
}
form.el-form.demo-formData {
  width: 100%;
  display: inline-block;
  text-align: left;
  .a_link {
    color: #00a0e9;
  }
  table {
    width: 100%;
    border-top: 1px solid #dbdbdb;
    border-left: 1px solid #dbdbdb;
    td {
      padding: 16px 18px;
      border-bottom: 1px solid #dbdbdb;
      border-right: 1px solid #dbdbdb;
    }
    .title {
      width: 177px;
      background-color: #f8f9fb;
      font-weight: 500;
      text-align: right;
    }
    .general {
      color: #6dd400;
    }
    .import {
      color: #fa6400;
    }
    .serious {
      color: #e02020;
    }
  }
}
.el-main .el-form-item {
  margin-bottom: 20px;
}
</style>
